﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace SangaiTech.Mvc
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            //type registrations for MVC
            Bootstrap.Bootstrapper.Register();
            Bootstrap.Bootstrapper.Container.Verify();
            DependencyResolver.SetResolver(Bootstrap.Bootstrapper.GetDependencyResolver());

            //type registrations for MVC Web Api
            Bootstrap.WebApiBootstrapper.Register();
            Bootstrap.WebApiBootstrapper.Container.Verify();
            System.Web.Http.GlobalConfiguration.Configuration.DependencyResolver = Bootstrap.WebApiBootstrapper.GetDependencyResolver();

        }
    }
}
